package o;

import android.content.Context;
import android.os.Bundle;
import android.text.TextUtils;
import com.huawei.appgallery.assistantdock.base.externalaction.openviewaction.OpenViewActionRegistry;
import com.huawei.appgallery.forum.base.card.ForumCardBean;
import com.huawei.appgallery.forum.posts.api.IPostDetailProtocol;
import com.huawei.appgallery.forum.posts.buoy.action.OpenDeleteCommentAction;
import com.huawei.appgallery.forum.posts.buoy.action.OpenDeletePostAction;
import com.huawei.appgallery.forum.posts.buoy.action.OpenExpansionPostAction;
import com.huawei.appgallery.forum.posts.buoy.action.OpenModifyCommentAction;
import com.huawei.appgallery.forum.posts.buoy.action.OpenMoreProductAction;
import com.huawei.appgallery.forum.posts.buoy.action.OpenPersonCenterAction;
import com.huawei.appgallery.forum.posts.buoy.action.OpenPostCommentDetailAction;
import com.huawei.appgallery.forum.posts.buoy.action.OpenPostContentImageAction;
import com.huawei.appgallery.forum.posts.buoy.action.OpenPostRecommendAction;
import com.huawei.appgallery.forum.posts.buoy.action.OpenReportPostAction;
import com.huawei.appgallery.forum.posts.card.BuoyForumCampaignNode;
import com.huawei.appgallery.forum.posts.card.BuoyForumNewCampaignNode;
import com.huawei.appgallery.forum.posts.card.BuoyForumPostDetailHeadNode;
import com.huawei.appgallery.forum.posts.card.BuoyForumProcuctNode;
import com.huawei.appgallery.forum.posts.card.BuoyForumRecommendNode;
import com.huawei.appgallery.forum.posts.card.BuoyForumTopicCommentNode;
import com.huawei.appgallery.forum.posts.card.ForumCampaignCardBean;
import com.huawei.appgallery.forum.posts.card.ForumCampaignNode;
import com.huawei.appgallery.forum.posts.card.ForumNewCampaignCardBean;
import com.huawei.appgallery.forum.posts.card.ForumNewCampaignNode;
import com.huawei.appgallery.forum.posts.card.ForumPostDetailHeadCardBean;
import com.huawei.appgallery.forum.posts.card.ForumPostDetailHeadNode;
import com.huawei.appgallery.forum.posts.card.ForumProcuctNode;
import com.huawei.appgallery.forum.posts.card.ForumProductBean;
import com.huawei.appgallery.forum.posts.card.ForumRecommendCardBean;
import com.huawei.appgallery.forum.posts.card.ForumRecommendNode;
import com.huawei.appgallery.forum.posts.card.ForumTopicCommentCardBean;
import com.huawei.appgallery.forum.posts.card.ForumTopicCommentNode;
import com.huawei.appgallery.forum.posts.request.GetPostProfilesResponse;
import com.huawei.appgallery.foundation.ui.framework.cardframe.bean.BaseCardBean;
import com.huawei.gamebox.plugin.gameservice.bean.GameInfo;

public class bze extends fhy {

    static class b implements o.brg.e {
        private b() {
        }

        public void ˎ(Context context, BaseCardBean baseCardBean) {
            bqx.ˊ("PostsDefine", "BuoyPostDispatcherListener onEvent");
            if (context == null || baseCardBean == null) {
                bqx.ॱ("PostsDefine", "null == context || !(bean instanceof BuoyBaseCardBean)");
                return;
            }
            dex o_bzc = new bzc(context);
            fae ˏ = ((faj) cdb.ॱ(faj.class)).ˏ();
            if (ˏ != null) {
                GameInfo gameInfo = ˏ.getGameInfo();
                Bundle bundle = new Bundle();
                bundle.putString("SEGMENT_URI", baseCardBean.ॱॱ());
                bundle.putString("APPID", TextUtils.isEmpty(baseCardBean.ͺˏ()) ? gameInfo.getAppId() : baseCardBean.ͺˏ());
                ((faj) cdb.ॱ(faj.class)).ˏ(context, o_bzc, bundle);
                return;
            }
            bqx.ॱ("PostsDefine", "buoyBridge == null");
        }
    }

    static class e implements o.brg.e {
        private e() {
        }

        public void ˎ(Context context, BaseCardBean baseCardBean) {
            fjb ˎ = fho.ˏ().ˋ("Posts").ˎ("post.detail.activity");
            IPostDetailProtocol iPostDetailProtocol = (IPostDetailProtocol) ˎ.ˊ();
            iPostDetailProtocol.setUri(baseCardBean.ॱॱ());
            if (baseCardBean instanceof ForumCardBean) {
                iPostDetailProtocol.setDomainId(((ForumCardBean) baseCardBean).ॱ());
            } else {
                iPostDetailProtocol.setDomainId(bqy.ˋ().ˎ());
            }
            iPostDetailProtocol.setStayTimeKey(baseCardBean.ˌॱ());
            fiu.ˊ().ˏ(context, ˎ);
        }
    }

    public void ˏ() {
        brf o_brf = (brf) fho.ˏ().ˋ("Base").ॱ(brf.class);
        o_brf.ॱ(ForumPostDetailHeadCardBean.NAME, ForumPostDetailHeadNode.class, ForumPostDetailHeadCardBean.class);
        o_brf.ॱ(ForumRecommendCardBean.NAME, ForumRecommendNode.class, ForumRecommendCardBean.class);
        o_brf.ॱ(ForumTopicCommentCardBean.NAME, ForumTopicCommentNode.class, ForumTopicCommentCardBean.class);
        o_brf.ॱ(ForumCampaignCardBean.NAME, ForumCampaignNode.class, ForumCampaignCardBean.class);
        o_brf.ॱ(ForumNewCampaignCardBean.NAME, ForumNewCampaignNode.class, ForumNewCampaignCardBean.class);
        o_brf.ॱ(bzp.APIMETHOD, GetPostProfilesResponse.class);
        o_brf.ॱ(ForumProductBean.NAME, ForumProcuctNode.class, ForumProductBean.class);
        o_brf.ॱ(ForumProductBean.BUOYNAME, BuoyForumProcuctNode.class, ForumProductBean.class);
        o_brf.ॱ(ForumPostDetailHeadCardBean.BUOYNAME, BuoyForumPostDetailHeadNode.class, ForumPostDetailHeadCardBean.class);
        o_brf.ॱ(ForumRecommendCardBean.BUOYNAME, BuoyForumRecommendNode.class, ForumRecommendCardBean.class);
        o_brf.ॱ(ForumTopicCommentCardBean.BUOYNAME, BuoyForumTopicCommentNode.class, ForumTopicCommentCardBean.class);
        o_brf.ॱ(ForumCampaignCardBean.BUOYNAME, BuoyForumCampaignNode.class, ForumCampaignCardBean.class);
        o_brf.ॱ(ForumNewCampaignCardBean.BUOYNAME, BuoyForumNewCampaignNode.class, ForumNewCampaignCardBean.class);
        brg o_brg = (brg) fho.ˏ().ˋ("Base").ॱ(brg.class);
        o_brg.ˊ("topic_detail", new e());
        o_brg.ˏ("topic_detail", new b());
        OpenViewActionRegistry.register(OpenExpansionPostAction.ACTION_OPEN_FORUM_EXPANSION_POST, OpenExpansionPostAction.class);
        OpenViewActionRegistry.register(OpenDeletePostAction.ACTION_OPEN_FORUM_DELETE_POST, OpenDeletePostAction.class);
        OpenViewActionRegistry.register(OpenReportPostAction.ACTION_OPEN_FORUM_REPORT_POST, OpenReportPostAction.class);
        OpenViewActionRegistry.register(OpenPostCommentDetailAction.ACTION_OPEN_FORUM_POST_COMMENT, OpenPostCommentDetailAction.class);
        OpenViewActionRegistry.register(OpenModifyCommentAction.ACTION_OPEN_FORUM_POST_MODIFY, OpenModifyCommentAction.class);
        OpenViewActionRegistry.register(OpenDeleteCommentAction.ACTION_OPEN_FORUM_DELETE_COMMENT, OpenDeleteCommentAction.class);
        OpenViewActionRegistry.register(OpenPostContentImageAction.ACTION_OPEN_FORUM_POST_CONTENT_IMAGE, OpenPostContentImageAction.class);
        OpenViewActionRegistry.register(OpenPersonCenterAction.ACTION_OPEN_PERSON_CENTER, OpenPersonCenterAction.class);
        OpenViewActionRegistry.register(OpenPostRecommendAction.ACTION_OPEN_FORUM_POST_RECOMMEND, OpenPostRecommendAction.class);
        OpenViewActionRegistry.register(OpenMoreProductAction.ACTION_OPEN_MORE_PRODUCT, OpenMoreProductAction.class);
    }
}
